<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8" />
    <title>邮件详情</title>
    <style>
        /* 全局样式 */
        body {
            font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
            background-color: #f9f9f9;
            margin: 0;
            padding: 0;
            color: #333;
            line-height: 1.6;
        }

        .email-container {
            max-width: 800px;
            margin: 60px auto;
            background-color: white;
            border-radius: 12px;
            padding: 30px;
            box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
            transition: transform 0.3s ease;
        }

        .email-container:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
        }

        /* 邮件标题样式 */
        .email-title {
            font-size: 28px;
            font-weight: 600;
            color: #3a7d44;
            margin-bottom: 20px;
            text-align: center;
        }

        /* 邮件元信息样式 */
        .email-meta {
            display: flex;
            flex-wrap: wrap;
            gap: 20px;
            margin-bottom: 25px;
            padding-bottom: 20px;
            border-bottom: 1px solid #eee;
        }

        .email-meta span {
            font-size: 15px;
            color: #555;
        }

        .email-meta strong {
            color: #333;
            font-weight: 600;
            width: 80px;
            display: inline-block;
        }

        /* 邮件内容样式 */
        .email-content {
            line-height: 1.8;
            color: #444;
            font-size: 15px;
            margin-bottom: 30px;
            padding: 20px;
            background-color: #fafafa;
            border-radius: 8px;
        }

        /* 按钮样式 */
        .button-group {
            display: flex;
            justify-content: center;
            margin-top: 30px;
        }

        .btn {
            display: inline-block;
            padding: 10px 25px;
            background-color: #4CAF50;
            color: white;
            text-decoration: none;
            border-radius: 6px;
            font-size: 15px;
            transition: all 0.3s ease;
            border: none;
            cursor: pointer;
        }

        .btn:hover {
            background-color: #388e3c;
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        }

        /* 响应式设计 */
        @media (max-width: 768px) {
            .email-container {
                margin: 30px 15px;
                padding: 20px;
            }

            .email-title {
                font-size: 24px;
            }

            .email-meta {
                flex-direction: column;
                gap: 10px;
            }
        }
    </style>
</head>
<body>

<div class="email-container">
    <h1 class="email-title">邮件详情</h1>
    <div class="email-meta">
        <span><strong>用户ID：</strong><span th:text="${email.userId}">1001</span></span>
        <span><strong>用户名：</strong><span th:text="${email.username}">张三</span></span>
        <span><strong>发件人：</strong><span th:text="${email.sendperson}">admin@example.com</span></span>
        <span><strong>时间：</strong><span th:text="${#temporals.format(email.createdAt, 'yyyy-MM-dd HH:mm')}">2024-01-01 12:00</span></span>
    </div>

    <div class="email-content">
        <p>这是一封系统自动发送的邮件，用于通知您实验室的相关信息。</p>
        <p><strong>尊敬的用户：你好</strong><span th:text="${email.email}">user@example.com</span></p>
        <p>如有疑问，请联系实验室人员。</p>
    </div>
</div>

<div class="button-group">
    <a th:href="@{/user/index}" class="btn">返回首页</a>
</div>

</body>
</html>